var cluster = require('cluster');
// var numC
// var history = require('./app.js').hisdata;
// console.log(history);
// var saveHis = setInterval(function(){
//     saveFile();
// }, 3000);
if(cluster.isMaster){
	for (var i = 0; i < 1; i++)
		var worker = cluster.fork();
} else {
	require('./app.js');
	console.log('worker is running');
}

cluster.on('exit', function(worker) {
	console.log('worker' + worker.pid +' died . restert ....');
	cluster.fork();
})
// process.on('SIGTERM', function(){
// 	console.log('kill');
// })